import React from 'react'
import { HashRouter as Router, Route, Switch } from 'react-router-dom'
import { set } from './config'
import App from '../pages/base/app'
import Example from '../pages/base/example'
import Login from '../pages/base/login'
import Notfound from '../pages/base/notfound'
import Echarts from '../pages/menu/echarts'
import Editor from '../pages/menu/editor'
import UserManage from '../pages/set/userManage'
import RoleManage from '../pages/set/roleManage'
import ModuleManage from '../pages/set/moduleManage'


export default () => (
  <Router>
    <Route path="/">
      <App>
        <Switch>
          <Route path="/desk$/index">
            <Example />
          </Route>
          <Route path="/echarts">
            <Echarts />
          </Route>
          <Route path="/editor">
            <Editor />
          </Route>
          <Route path={`/${set}/userManage`}>
            <UserManage />
          </Route>
          <Route path={`/${set}/roleManage`}>
            <RoleManage />
          </Route>
          <Route path={`/${set}/moduleManage`}>
            <ModuleManage />
          </Route>
        </Switch>
      </App>
    </Route>
    <Route path="*" component={Notfound} />
    <Route path="/login" component={Login} />
  </Router>
)
